I'm sure I must be doing something trivially wrong, but I seem to have encountered a bug in the way that Think C initializes arrays. Specifically, if the
array has only 2 elements in it (arrays in question are of type 'char') and
if the array is initialized at declaration (e.g. char word6[] = { 'a', 't', '\0'} and if the array is initialized as part of the initialization of several
similar arrays (i.e. suppose 3 arrays of type char are all declared and
initialized in one piece of code), THink C seems to be unable to correctly
insert the termination character for the 2-character-length array.
Has anybody heard of this bug or should I figure that I'm really missing
something obvious. I have stepped through in the debugger and the incorrect
action definitely occurs at declaration, i.e. the array isn't begin written
over at some later point in the program. I am running 4.0
Thanks for the help.
charlie mead
Path: ucivax!gateway
From: wadew@ducvax.auburn.edu (Wade Williams)
Subject: #$! Prototypes!
Message-ID: <8A78316B480068BC@ducvax.auburn.edu>
Newsgroups: fa.think-c
Lines: 43
Date: 4 Jan 92 01:24:26 GMT
X-Envelope-to: think-c@ics.uci.edu
Ok, last question (you don't believe that do you?):
If I have my function protyped as:
void DoMenu(EventRecord *gtheEvent);
called as:
DoMenu(>heEvent);
and declared as:
void DoMenu(EventRecord *gtheEvent)
{
some code...
}
with the variable declared as:
EventRecord gtheEvent;
why do I get a "argument to function does not match prototype" error? The
way I see it, I'm passing it a pointer to an event record, and I specify in
the prototype that it will be receiving a pointer to an event record. I
have turned off strict prototype enforcement, but it doesn't help.
I understood why I had to call get new window with:
GetNewWindow(128, NIL, (WindowPtr)-1);
But I don't see what I'm doing wrong on this one.
Again, I apologize for my ignorance..I just don't have any Mac C